<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
                xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <title>我的事项专报</title>


    <!-- JS -->
    <script type="text/javascript" th:src="@{/myconfig/bootstrap/js/jquery.js}" src="myconfig/bootstrap/js/jquery.js"></script>
    <script type="text/javascript" th:src="@{/myconfig/bootstrap/js/bootstrap.min.js}" src="myconfig/bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" th:src="@{/myconfig/layui/layui.js}" src="myconfig/layui/layui.js"></script>



    <!-- CSS -->
    <link th:href="@{/myconfig/bootstrap/css/bootstrap.min.css}" href="myconfig/bootstrap/css/bootstrap.min.css" type="text/css" rel="stylesheet" media="all">
    <link th:href="@{/myconfig/layui/css/layui.css}" href="myconfig/layui/css/layui.css" type="text/css" rel="stylesheet" media="all">
</head>
<body>

<!-- 数据表格 -->
<table class="layui-hide" id="listMyReport" lay-filter="myReports"></table>

<!-- 表格 格式 审批状态-->
<script type="text/html" id="stateColor">
    {{#  if(d.reportState === '审批通过'){ }}
    <span><i class="layui-badge-dot layui-bg-green"></i>{{ d.reportState }}</span>
    {{#  } else if(d.reportState === '审批驳回') { }}
    <span><i class="layui-badge-dot layui-bg-red"></i>{{ d.reportState }}</span>
    {{#  } else{ }}
    <span><i class="layui-badge-dot layui-bg-orange"></i>{{ d.reportState }}</span>
    {{#  } }}
</script>



<script th:inline="none">
    layui.use("table",function () {
        var table = layui.table;
        $.ajax({
            url: "myItemReport/listMyReport",
            type: "post",
            success: function (result) {
                var data = result.data;
                table.render({
                    id: 'myReports',
                    elem: "#listMyReport",
                    title: "待审批专报",
                    page: true,
                    limits: [5, 10, 15, 20],
                    limit: 10,
                    group: 5,
                    height: 520,
                    data: data,
                    cols: [[
                        {field: 'reportId', title: '专报ID', sort: true, width: '10%', align: 'center'},
                        {field: 'reportRecender', title: '专报接收者', width: '15%', align: 'center'},
                        {field: 'reportContent', title: '专报标题', width: '35%', align: 'center'},
                        {field: 'reportState', title: '专报审批状态',sort: true, width: '10%', align: 'center', templet: '#stateColor'},
                        {field: 'reportFounder', title: '专报创建者', width: '15%', align: 'center'},
                        {field: 'reportCreateTime', title: '专报创建时间', width: '15%', align: 'center', sort: true},
                    ]]
                });
            }
        });
    })
</script>


</body>
</html>